package Graficos;

import java.util.Vector;

import javax.swing.Icon;
import javax.swing.ImageIcon;


public class GraficaPersonaje {
	protected Vector<Icon> grafico;
	protected int index = 0;
	
	public GraficaPersonaje()
	{
		this.grafico = new Vector<Icon>();		
	}
	
	public void addImage( Icon ii )
	{
		this.grafico.add(ii);
	}
	
	public Icon getImage( int i )
	{
		if( this.grafico.size() > 0 )
		{
			return this.grafico.get(i);
		} else {
			return null;
		}
}
	public Icon getImage()
	{
		Icon c = null;
		if( this.grafico.size() > 0 )
		{
			c = this.grafico.get(this.index);
			if( this.index < this.grafico.size() -1 )
			{
				this.index++;
			} else {
				this.index = 0;
			}
		}
		return c;
	}}
